package org.dinqy;

/**
 * @author armandino (at) gmail.com
 */
public final class ClauseBeanFactory {
    private ClauseBeanFactory() {}
    
    public static ClauseBean where(String fieldName, Criterion criterion) {
        return new WhereClauseBean(fieldName, ClauseType.WHERE, criterion);
    }
    
    public static ClauseBean and(String fieldName, Criterion criterion) {
        return new WhereClauseBean(fieldName, ClauseType.AND, criterion);
    }

    public static ClauseBean or(String fieldName, Criterion criterion) {
        return new WhereClauseBean(fieldName, ClauseType.OR, criterion);
    }
    
    public static ClauseBean asc(String fieldName) {
        return new OrderClauseBean(ClauseType.ASC, fieldName);
    }
    
    public static ClauseBean desc(String fieldName) {
        return new OrderClauseBean(ClauseType.DESC, fieldName);
    }
    
    public static ClauseBean limit(int value) {
        return new LimitOffsetClauseBean(ClauseType.LIMIT, value);
    }
    
    public static ClauseBean offset(int value) {
        return new LimitOffsetClauseBean(ClauseType.OFFSET, value);
    }
    
}
